#ifndef __PWHDR_STDLIB_HPP__
#define __PWHDR_STDLIB_HPP__

#include "sys_config.h"

// STL
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <algorithm>

// C headers
#include <cstdlib>
#include <cstdio>
#include <cstring>

#ifdef HAVE_STDINT_H
#	include <stdint.h>
#endif//HAVE_STDINT_H

#ifdef HAVE_INTTYPE_H
#	include <inttype.h>
#endif//HAVE_INTTYPE_H

#ifdef HAVE_UNISTD_H
#	include <unistd.h>
#endif//HAVE_UNISTD_H

#include <errno.h>
#include <sys/types.h>

#ifdef HAVE_SYS_POLL_H
#	include <sys/poll.h>
#endif//HAVE_SYS_POLL_H

#ifdef HAVE_POLL_H
#	include <poll.h>
#endif//HAVE_POLL_H

#ifdef HAVE_FCNTL_H
#	include <fcntl.h>
#endif//HAVE_FCNTL_H

#ifdef HAVE_IOCTL_H
#	include <ioctl.h>
#endif//HAVE_IOCTL_H

#ifdef HAVE_SYS_IOCTL_H
#	include <sys/ioctl.h>
#endif//HAVE_SYS_IOCTL_H

#ifdef HAVE_DLFCN_H
#	include <dlfcn.h>
#endif//HAVE_DLFCN_H

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>

#ifdef HAVE_SYS_MMAN_H
#	include <sys/mman.h>
#endif//HAVE_SYS_MMAN_H

#ifdef HAVE_SYS_EPOLL_H
#	include <sys/epoll.h>
#endif//HAVE_SyS_EPOLL_H

#ifdef HAVE_EPOLL_H
#	include <epoll.h>
#endif//HAVE_EPOLL_H

#ifdef HAVE_SEMAPHORE_H
#	include <semaphore.h>
#endif//HAVE_SEMAPHORE_H

#ifdef HAVE_MQUEUE_H
#	include <mqueue.h>
#endif//HAVE_MQUEUE_H

#ifdef HAVE_STRCASECMP
#	define __PWSTRCMP_I(x,y)		strcasecmp(x,y)
#elif HAVE_STRICMP
#	define __PWSTRCMP_I(x,y)		stricmp(x,y)
#else
#	define __PWSTRCMP_I(x,y)		strcmp(x,y)
#endif//HAVE_STRCASECMP

#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif//!HAVE_SOCKLEN_T

#ifdef HAVE_SYS_STAT_H
#	include <sys/stat.h>
#endif//HAVE_SYS_STAT_H

#ifdef HAVE_STAT_H
#	include <stat.h>
#endif//HAVE_STAT_H

#ifdef HAVE_SYS_STATVFS_H
#	include <sys/statvfs.h>
#endif//HAVE_SYS_STATVFS_H

#ifdef HAVE_STATVFS_H
#	include <statvfs.h>
#endif//HAVE_STATVFS_H

#include <signal.h>


#define __PWERRNO_NOIMPL()	do { errno = ENOSYS; } while (false)

#include "liblog.hpp"

#endif//!__PWHDR_STDLIB_HPP__

